package com.aiyige.page.my.customer.model;

import com.aiyige.R;
import com.aiyige.utils.StringUtils;

/**
 * 客户类型
 * 客户类型：0-全部用户，10-潜在客户，20-意向客户，30-失效客户，40-成交客户
 * Created by xiachao on 2018/3/22.
 */

public class CustomerType {
    /**
     * 全部客户
     */
    public final static String ALL_CUSTOMER = "0";

    /**
     * 成交客户
     */
    public final static String TRANSACTION_CUSTOMER = "40";

    /**
     * 意向客户
     */
    public final static String INTENTION_CUSTOMER = "20";

    /**
     * 潜在客户
     */
    public final static String POTENTIAL_CUSTOMER = "10";

    /**
     * 失效客户
     */
    public final static String LOSE_CUSTOMER = "30";


    public static String getName(String type) {
        if (type.equals(ALL_CUSTOMER)) {
            return StringUtils.getString(R.string.all_customer);
        }
        else if (type.equals(TRANSACTION_CUSTOMER)) {
            return StringUtils.getString(R.string.transaction_customer);
        }
        else if (type.equals(INTENTION_CUSTOMER)) {
            return StringUtils.getString(R.string.intention_customer);
        }
        else if (type.equals(POTENTIAL_CUSTOMER)) {
            return StringUtils.getString(R.string.potential_customer);
        }
        else if (type.equals(LOSE_CUSTOMER)) {
            return StringUtils.getString(R.string.lose_customer);
        }

        return "";
    }

    public static String getKey(String typeName) {
        if (typeName.equals(StringUtils.getString(R.string.all_customer))) {
            return ALL_CUSTOMER;
        }
        else if (typeName.equals(StringUtils.getString(R.string.transaction_customer))) {
            return TRANSACTION_CUSTOMER;
        }
        else if (typeName.equals(StringUtils.getString(R.string.intention_customer))) {
            return INTENTION_CUSTOMER;
        }
        else if (typeName.equals(StringUtils.getString(R.string.potential_customer))) {
            return POTENTIAL_CUSTOMER;
        }
        else if (typeName.equals(StringUtils.getString(R.string.lose_customer))) {
            return LOSE_CUSTOMER;
        }

        return "";
    }
}
